﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Places.master" AutoEventWireup="false" CodeFile="PlacesViewPlacesDetails.aspx.vb" Inherits="PlacesViewPlacesDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DetailsView ID="DVPlaces" runat="server" Height="50px" Width="125px" 
        AllowPaging="True" AutoGenerateRows="False" 
        DataSourceID="DSPlaces">
        <Fields>
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:BoundField DataField="AlCategory" HeaderText="AlCategory" 
                SortExpression="AlCategory" />
            <asp:BoundField DataField="tblAlbum.ID" HeaderText="tblAlbum.ID" 
                SortExpression="tblAlbum.ID" InsertVisible="False" />
            <asp:BoundField DataField="tblPlaces.ID" HeaderText="tblPlaces.ID" 
                SortExpression="tblPlaces.ID" InsertVisible="False" />
            <asp:BoundField DataField="Location" HeaderText="Location" 
                SortExpression="Location" />
            <asp:ImageField DataImageUrlField="Picture" HeaderText="Picture">
                <ControlStyle CssClass="placeDetails" />
            </asp:ImageField>
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="DSPlaces" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        
        SelectCommand="SELECT * FROM [VAlbumPlaces] WHERE ([Picture] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Picture" QueryStringField="Picture" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
      <fieldset>
    <legend>Total Comments</legend>
          <asp:GridView ID="GVCommTotal" runat="server" AutoGenerateColumns="False" 
              DataKeyNames="Picture" DataSourceID="DSTotalComm">
              <Columns>
                  <asp:BoundField DataField="Coments" HeaderText="Coments" 
                      SortExpression="Coments" />
                  <asp:BoundField DataField="Picture" HeaderText="Picture" InsertVisible="False" 
                      ReadOnly="True" SortExpression="Picture" />
              </Columns>
          </asp:GridView>
          <asp:SqlDataSource ID="DSTotalComm" runat="server" 
              ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
              ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
              SelectCommand="SELECT DISTINCT * FROM [QPlaCommentTotal] WHERE ([Picture] = ?)">
              <SelectParameters>
                  <asp:QueryStringParameter Name="Picture" QueryStringField="ID" Type="Int32" />
              </SelectParameters>
          </asp:SqlDataSource>
          </fieldset>
	<br />
		<br />
        <form class="input-frm" >
    <h1>Tag
        <span>Choose a tag or Create one of your own</span>
    </h1>
    <label>
        <span> Tags :</span>
        <asp:CheckBoxList ID="cbListTag" runat="server" DataSourceID="DSTag" 
            DataTextField="Tag" DataValueField="ID" RepeatDirection="Horizontal">
        </asp:CheckBoxList>
    </label>
    
      <label>
        <span>Add New Tag :</span>
        <asp:TextBox ID="tbTag" runat="server"></asp:TextBox>
        </label> 
   <asp:SqlDataSource ID="DSTag" runat="server" 
            ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
            ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
            
            SelectCommand="SELECT DISTINCT * FROM [tblTagPlace] WHERE ([Tag] &lt;&gt; ?)">
            <SelectParameters>
                <asp:Parameter DefaultValue="&quot;  &quot;" Name="Tag" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
     <label>
        <span>&nbsp;</span> 
        <asp:Button ID="Button1" runat="server" Text="Tag It!" />
    </label>    
</form>

        
 <br />
 <form class="input-frm">
 <h1>Comments
        <span>Comments are below</span>
    </h1>
      <asp:GridView ID="GVPlaceComm" runat="server" AutoGenerateColumns="False" 
          DataSourceID="QPlaComm">
          <Columns>
              <asp:BoundField DataField="Author" HeaderText="Author" 
                  SortExpression="Author" />
              <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
              <asp:BoundField DataField="Comment" HeaderText="Comment" 
                  SortExpression="Comment" />
          </Columns>
      </asp:GridView>
      <asp:SqlDataSource ID="QPlaComm" runat="server" 
          ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
          ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
          SelectCommand="SELECT DISTINCT * FROM [QPlaComm] WHERE ([PicID] = ?)">
          <SelectParameters>
              <asp:QueryStringParameter Name="PicID" QueryStringField="ID" Type="Int32" />
          </SelectParameters>
      </asp:SqlDataSource>
 </form>
<br />
	
		<form action="" class="input-frm">
       <h1>Add Comment
        <span>Enter Details in the field below</span>
    </h1>
<span> Tags :</span><asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
<br />
<span> Comment :</span><asp:TextBox ID="txtcontent" runat="server" TextMode="MultiLine" 
        Height="277px" Width="330px" ToolTip="Enter Article Details here"></asp:TextBox>

        <br />
        <asp:Button ID="btnComment" runat="server" Text="Add Comment!" />
        </form>
       
</asp:Content>

